<template>
  <div class="approve-history">
    <lb-table
      v-if="tableVisible"
      :column="tableColumn"
      :data="tableData"
      :table-info="tableInfo"
      background
    />
  </div>
</template>
<script>
import Qibao from '@/admin'
const { tableFunc } = Qibao
export default {
  name: 'ApproveHistory',
  components: {},
  props: {
    approvalList: {
      type: Object,
      default() {
        return {}
      }
    }
  },
  data() {
    return {
      tableVisible: false,
      tableColumn: [],
      tableData: [],
      tableInfo: {}
    }
  },
  watch: {
    approvalList: {
      deep: true,
      immediate: true,
      handler(newValue) {
        const {
          tableInfo,
          data
        } = newValue
        if (tableInfo && data) {
          this.tableInfo = tableInfo
          this.tableColumn = tableFunc.createTableColumn(tableInfo)
          this.tableData = tableFunc.createTableData(data)
          this.tableVisible = true
        }
      }
    }
  }
}
</script>
<style lang='scss' scoped>
</style>
